package com.yuyou.fn.educational.service;

import com.github.wens.framework.service.ISuperService;
import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.educational.entity.CourseClass;
import com.yuyou.fn.educational.entity.DiscountCode;
import com.yuyou.fn.educational.vo.DiscountCodeCreateVo;
import com.yuyou.fn.educational.vo.DiscountCodeQueryVo;

import java.math.BigDecimal;
import java.util.List;

/**
 *
 * DiscountCode 表数据服务层接口
 *
 */
public interface IDiscountCodeService extends ISuperService<DiscountCode,Long> {

    void createDiscountCode(DiscountCodeCreateVo discountCodeCreateVo);

    Page<DiscountCode> findByQuery(DiscountCodeQueryVo discountCodeQueryVo,Integer pageNo , Integer pageSize );

    void updateEnableStatus(List<Long> discountCodeIds,Integer enableStatus);

    DiscountCode checkCode(Long courseOrderId ,String discountCode , BigDecimal orderPayableAmount , List<CourseClass> courseClasses);

    DiscountCode checkDiscountCodeStatus(String discountCode);

    void updateUsedStatus(String discountCode);

    void lock(Long courseOrderId , String discountCode);

    void unlock(String discountCode);
}